/************************************************************
 * Copyright (C), 2022-2030, ripnano. Co., Ltd.
 * FileName:        form_light_lamp.h
 * Author:          Dan Yin
 * Date:            2023-10-13
 * Description:     the class of UV lamp manage
 * Version:         1.0.0.0
 **********************************************************/

#ifndef FORM_LIGHT_LAMP_H
#define FORM_LIGHT_LAMP_H

// add necessary includes here
#include "ui/defines/global.h"


namespace Ui {
class FormLightLamp;
}

class FormLightLamp : public QWidget
{
    Q_OBJECT

public:
    // Get an instance of "FormLightLamp" class, if exist, return it
    static FormLightLamp* getInstance(QWidget *pParent = nullptr);

    // Set the prompt info on window
    void setPromptInfo(QString sTitle, QString sPromptInfo, int nTimeout = 0);

protected:
    // Triggers an event before it is switch language
    void changeEvent(QEvent *event);

private slots:
    void on_pushButton_Confirm_clicked();

    // Timeout for disinfect
    void slotLightTimeout();

    // Notify the door status
    void slotDoorStatusDetected(unsigned int unCanId, QStringList lstJsonParams, int nResult);

private:
    // The default constructor
    explicit FormLightLamp(QWidget *parent = nullptr);

    // The default destructor
    virtual ~FormLightLamp();

    // After constructing object, initialize the object
    void _Initialze();

    // Init the window style
    void _InitUi();

    // Convert seconds to time
    QString _seconds2Time(int nSeconds);

private:
    Ui::FormLightLamp *ui;

    QTimer  *m_pTimer = nullptr;
    int     m_nTimeRemain = 0;
};

#endif // FORM_LIGHT_LAMP_H
